﻿/**
 * 
 * @file OperScript.h
 * @brief  脚本操作声明
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-11-05
 * 
 */
#ifndef __OPER_SCRIPT_H___
#define  __OPER_SCRIPT_H___ 
 

#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"

namespace GUIOper
{
    /**
     * @brief 脚本相关操作器
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-11-05
     */
    class OperScript :public Core::FITKActionOperator
    {
    public:
        /**
         * @brief 脚本相关操作器
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */
        explicit OperScript() = default;
        /**
         * @brief Destroy the Oper Working Dir object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-31
         */
        virtual ~OperScript() = default;
        /**
         * @brief 执行GUI操作程序，选择文件对话框
         * @return true
         * @return false
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        virtual bool execGUI() override;

    private:
        /**
         * @brief 记录脚本
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */
        void recordScript();
        /**
         * @brief 结束脚本记录
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */
        void endScript();
        /**
         * @brief 执行脚本文件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */
        void runScript();

    };

    // 按钮注册相关操作

    Register2FITKOperatorRepo(actionRecordScript, OperScript);
    Register2FITKOperatorRepo(actionEndScript, OperScript);
    Register2FITKOperatorRepo(actionRunScript, OperScript);
}


#endif
